<?php

namespace App\Transformers\Web;

use League\Fractal\TransformerAbstract;

class EmigratedTranformer extends TransformerAbstract
{
    public function transform($emigrated)
    {
        return [
            'id' => $emigrated->id,
            'total' => $emigrated->total,
            'fraction' => $emigrated->fraction,
            'status' => $emigrated->status,
            'created_at' => $emigrated->created_at->format('Y-m-d H:i:s'),
            'category' => $emigrated->category->name,
            'subject' => $emigrated->subject->name
        ];
    }
}

